package com.hxgis.common.enums;

import lombok.Getter;

import java.util.Objects;

/**
 * @author cqj
 * @version 1.0
 * @date 2019/10/28 15:11
 */
@Getter
public enum DataColorFigEnum {

    //avg30 values  historyAvgRate  maxHistoryAvgRate  minHistoryAvgRate  maxValues  minValues

    VALUES("values"," 实况值"),
    MAXVALUES("maxValues"," 极大值"),
    MINVALUES("minValues"," 极小值"),
    AVG("avg30"," 30年平均"),
    HISTORYAVGRATE("historyAvgRate"," 距平"),
    MAXHISTORYAVGRATE("maxHistoryAvgRate"," 极大值"),
    MINHISTORYAVGRATE("minHistoryAvgRate"," 极小值"),
    ;

    private String type;

    private String message;


    DataColorFigEnum(String type, String message) {
        this.type = type;
        this.message = message;
    }

    public static DataColorFigEnum getSplashColorEnum(String flag) {
        DataColorFigEnum[] values = DataColorFigEnum.values();
        for (DataColorFigEnum value : values) {
            if (Objects.equals(value.getType(),flag)){
                return value;
            }
        }
        return null;
    }
}
